Skip to content

ci: reduce PR test runtime without reducing coverage#294

Merged
munezaclovis merged 8 commits into
mainfrom
perf/ci-performance
Jul 13, 2026
Merged

ci: reduce PR test runtime without reducing coverage#294
munezaclovis merged 8 commits into
mainfrom
perf/ci-performance

Conversation

@munezaclovis

@munezaclovis munezaclovis commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove the blanket nextest group that serialized 254 daemon-related tests
  • fix Redis and RustFS test fixtures whose same-thread Python shutdown() calls waited for the supervisor grace period
  • replace the fast-exit Mailpit shell wrapper with a directly supervised Python fixture and add public ownership coverage
  • move recipe CLI parsing/dispatch coverage into the existing integration test
  • add the vetted pinned Rust build cache and remove redundant recipe and internal-rustdoc CI steps
  • document the diagnosis, design, and implementation plan

Root cause

The cited PR job took 7m04s, including a 4m32s test step. The nextest override serialized a 254-test union representing roughly 95% of aggregate test execution. Several Redis/RustFS fixtures also called socketserver.BaseServer.shutdown() from the same thread as serve_forever(), so they waited for the production ten-second grace/force-kill path. CI additionally rebuilt internal Rust docs, repeated recipe CLI work outside the test suite, and had no Rust build cache.

Impact

The full application suite remains selected. Three consecutive final default-profile runs each passed all 1,004 selected tests, with nextest execution of:

  • 34.228s
  • 32.839s
  • 33.479s

This is local execution evidence only; the PR's GitHub Actions wall time should be evaluated from the remote run. Internal Rust docs no longer gate PRs by design, while recipe binary dispatch remains automatically covered by integration tests.

Validation

  • focused supervisor ownership and fast-exit cleanup tests
  • focused Redis/RustFS tests
  • recipe fixture integration tests through the compiled binary
  • three consecutive full workspace nextest runs: 1,004/1,004 passed, 6 skipped
  • cargo fmt --all --check
  • locked workspace Clippy with all targets/features and warnings denied
  • cargo shear
  • recipe shellcheck
  • actionlint .github/workflows/ci.yml
  • independent whole-branch review with no Critical, Important, or Minor findings

Summary by CodeRabbit

  • CI Improvements

    • Cached Rust build artifacts to speed up CI.
    • Simplified CI test execution to restore normal scheduling and reduce unnecessary steps.
    • Removed extra artifact/metadata and docs build phases, keeping focused test runs.
  • Bug Fixes

    • Improved daemon fixture shutdown behavior to avoid deadlocks and ensure controlled, repeatable termination.
    • Made Mailpit and process-exit tracking fixtures more deterministic.
    • Added macOS coverage for verifying ownership of Python shebang runtime scripts.
  • Tests

    • Updated recipe-fixture generation tests to exercise the pv-release command-line flow directly.
  • Documentation

    • Added CI performance plan and design specification documents.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ddfc4047-56a4-47cb-80a1-c28b83e358df

📥 Commits

Reviewing files that changed from the base of the PR and between 3188967 and 26eb2ec.

📒 Files selected for processing (1)
  • crates/daemon/src/managed_resources/tests.rs

📝 Walkthrough

Walkthrough

The changes add Rust CI caching, restore normal nextest scheduling, stabilize daemon fixture shutdown and process ownership tests, and route recipe generation coverage through the pv-release binary. Supporting plan and design documents describe the workflow and verification updates.

Changes

CI performance changes

Layer / File(s) Summary
Daemon fixture lifecycle and ownership tests
crates/daemon/src/managed_resources/tests.rs, crates/daemon/tests/supervisor_foundation.rs
Python-based fixtures now use guarded background-thread shutdown, the Mailpit fixture runs directly from a Python shebang, and a macOS test verifies ownership of the executable process.
Recipe CLI integration coverage
crates/pv-release/tests/recipe_fixtures.rs
Recipe fixture and manifest generation now execute the pv-release binary with command-output diagnostics.
Cached CI test workflow and scheduling
.github/workflows/ci.yml, .config/nextest.toml
Rust build caching is added, redundant metadata and documentation steps are removed, and daemon-specific nextest serialization is deleted.
CI performance plan and design specification
docs/superpowers/plans/..., docs/superpowers/specs/...
The documents describe the fixture, workflow, scheduling, coverage, and verification changes.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Possibly related PRs

Poem

I’m a rabbit with tests in my burrow,
Watching fast fixtures hurry.
Cache piles grow, shutdowns unwind,
Recipe commands now run combined.
Hop, hop—CI springs bright and merry!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the PR’s main goal: speeding up CI while keeping test coverage intact.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/ci-performance

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@munezaclovis
munezaclovis marked this pull request as ready for review July 12, 2026 21:52
@codspeed-hq

codspeed-hq Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 7 untouched benchmarks


Comparing perf/ci-performance (26eb2ec) with main (c3fb019)

Open in CodSpeed

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The Redis fixture can still hit the ten-second supervisor fallback when a client connection is active during shutdown.

Reviewed changes — This PR restores parallel nextest scheduling, removes redundant CI work, and repairs slow process fixtures while retaining application and recipe CLI coverage.

  • Restore normal test scheduling — Deletes the blanket daemon-lifecycle group so independent daemon tests can run concurrently.
  • Streamline the macOS CI job — Adds the pinned Swatinem/rust-cache action and intentionally removes the internal rustdoc and standalone recipe command gates.
  • Preserve recipe CLI coverage — Runs generate-recipe-fixtures and generate-manifest through the compiled pv-release binary inside the existing integration test.
  • Repair managed-resource fixtures — Directly supervises the fast-exit Python Mailpit fixture and delegates Redis and RustFS shutdown away from their serve_forever() threads.
  • Characterize script ownership — Adds macOS integration coverage for ownership verification of directly executable Python shebang scripts.
  • Document the performance design — Records the diagnosis, constraints, implementation sequence, and validation evidence.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using GPT Sol𝕏

Comment thread crates/daemon/src/managed_resources/tests.rs

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — The new commit closes the Redis fixture shutdown gap identified in the prior review and adds direct regression coverage for the active-client case.

  • Daemonized Redis fixture handlers — Set RedisServer.daemon_threads so a handler blocked on an open client connection cannot keep the fixture process alive after shutdown.
  • Covered active-client shutdown — Added redis_fixture_stops_gracefully_with_active_client_connection to retain a verified Redis client connection while asserting supervised shutdown avoids the ten-second fallback.

Pullfrog  | View workflow run | Using GPT Sol𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The latest commit removes the only regression coverage for the active-client Redis shutdown failure fixed after the prior review.

Reviewed changes — Reviewed the test-only delta since the prior Pullfrog review, which removed the Redis active-client shutdown regression test while retaining the fixture implementation fix.

  • Removed active-client shutdown coverage — Deleted redis_fixture_stops_gracefully_with_active_client_connection and its supporting imports without adding replacement coverage.

⚠️ The Redis shutdown fix has lost its regression coverage

The deleted test was the only case that held a live Redis client connection open while stopping the supervised fixture. Existing Redis reconciliation tests do not exercise that condition, so reverting daemon_threads = True can restore the ten-second fallback without failing CI; this also contradicts the PR's stated goal of reducing runtime without reducing coverage.

Technical details
# The Redis shutdown fix has lost its regression coverage

## Affected sites
- `crates/daemon/src/managed_resources/tests.rs` — commit `26eb2ec` deletes `redis_fixture_stops_gracefully_with_active_client_connection`, which was added in `3188967` to cover the exact active-handler failure identified in the prior review.
- `crates/daemon/src/managed_resources/tests.rs:4914``RedisServer.daemon_threads = True` remains the load-bearing fix, but no remaining test distinguishes it from the default `False` behavior.

## Required outcome
- Preserve automated coverage that keeps a Redis fixture handler active during supervised shutdown and proves shutdown completes before the ten-second force-kill fallback.

Pullfrog  | Fix it ➔View workflow run | Using GPT Sol𝕏

@munezaclovis
munezaclovis merged commit 04ddff4 into main Jul 13, 2026
4 checks passed
@munezaclovis
munezaclovis deleted the perf/ci-performance branch July 13, 2026 02:58

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 26eb2ec390

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml
--base-url https://artifacts.example.test

- name: Run tests
run: cargo nextest run --workspace --all-features --locked

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore rustdoc warning coverage

In the CI workflow I inspected, this is now the final Rust validation step; the previous cargo doc --workspace --all-features --no-deps --locked with RUSTDOCFLAGS=-D warnings was deleted. I checked cargo doc --help, which describes it as building package documentation, so PRs that introduce rustdoc-only warnings such as broken intra-doc links can now merge because the remaining test/clippy steps do not build docs. Please keep this step or replace it with an equivalent cheaper rustdoc check if the goal is no coverage loss.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant